<%@ LANGUAGE="VBSCRIPT" %>
<%'  ------------------------------------------------------------
  '  mz_chkoutlist.asp 
  '  ------------------------------------------------------------
  '  VCS INFO:
  '  
  '  $Revision:   1.35  $
  '  $Date:   21 May 1999 15:53:42  $
  '  $Author:   JLUM  $
  '  $Workfile:   mz_chkoutlist.asp  $
  '  ------------------------------------------------------------
  '  All Rights Reserved.  Copyright (c) 1988-1998 FileNET Corp.
  '  ------------------------------------------------------------
  '%>
<!-- #include file="islogon.asp" -->

<%
  LibraryLogonID = Session("LibraryLogonID")
  Set LibraryObj = Server.CreateObject("IDMObjects.Library")
  LibraryObj.LogonId = LibraryLogonID
  LibraryLabel = Session("LibraryLabel")
  Username = Session("Username")
  Response.AddHeader "pragma","no-cache"
    
%>

<!-- #include file="jscriptfix.asp" -->

<SCRIPT LANGUAGE="JavaScript">
<!--
// Called when the Show/View document button is pressed
function ShowDocument(docid)
{
  //
  // HTML & Native Document viewing.
  //
  parent.location.href = "viewer.asp?DocID=" + docid + "&library=<%=Server.URLEncode(LibraryObj.Name)%>"
}

// Called when the Checkin document button is pressed
function CheckinDocument(docid)
{
  parent.location.href = "checkin.asp?DocID=" + docid + "&library=<%=Server.URLEncode(LibraryObj.Name)%>"
}

// called when the Cancel CheckedOut Document button is pressed
function CancelCheckoutDocument(docid)
{
	location.href = "doccnclckout.asp?DocID=" + docid + "&Redirect=mz_chkoutlist.asp";
}

// Called when the Show Document Properties button is pressed
function ShowProperty(type, ident)
{
  parent.location.href = "property.asp?Type=" + type + "&Ident=" + ident;
}
//-->
</SCRIPT>


<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">

<html>
<head>
<title>List of CheckedOut Documents</title>
<meta name="GENERATOR" content="Microsoft FrontPage 1.1">
</head>

<%  
' get the list of checked out documents for the current user logged on
set Docs = LibraryObj.ActiveUserCheckoutList %>

<body bgcolor="#FFFFFF" topmargin=0 leftmargin=0>

<table cellpadding=0 cellspacing=0 width=100%>
<tr>

<td>
<IMG SRC="images/library.jpg" WIDTH="44" HEIGHT="39" ALIGN="CENTER" NATURALSIZEFLAG="3">
<strong><font size=4><%= Server.HTMLEncode(LibraryLabel) %></a>:</font>
</strong>
</td>

<td>
<strong>
<font size=3>  Documents Checked Out by <%= Server.HTMLEncode(Username) %></a></font>
</strong>
</td>

<td align=right valign=bottom>
<font size=2>(<%= Docs.Count %> documents)</font>
</td></tr>
</table>

<table cellpadding=0 cellspacing=1 width=100%>
<tr>
<td BGCOLOR=#CCCCFF align=center>&nbsp;</td>
<td BGCOLOR=#CCCCFF align=center>&nbsp;</td>
<td BGCOLOR=#CCCCFF align=center width=30>&nbsp;</td>
<% 
' only Document Server systems can have checked out documents
if LibraryObj.SystemType = Application("idmSysTypeDS") then %>
<td BGCOLOR=#CCCCFF align=left><font size=3><strong>&nbsp;&nbsp;Item ID&nbsp;&nbsp;</strong></font></td>
<td BGCOLOR=#CCCCFF align=left><font size=3><strong>&nbsp;&nbsp;Document Class&nbsp;&nbsp;</strong></font></td>
<td BGCOLOR=#CCCCFF align=left><font size=3><strong>&nbsp;&nbsp;Checkout Date&nbsp;&nbsp;</strong></font></td>
<td BGCOLOR=#CCCCFF align=left><font size=3><strong>&nbsp;&nbsp;Version&nbsp;&nbsp;</strong></font></td>
<% end if %>
<td BGCOLOR=#CCCCFF align=center width=20>&nbsp;</td>
</tr>

<%
   set oDocUtil = Server.CreateObject("IDMWeb.DocumentUtilities")
 %>


<% 
' enumerate through the list of checked out documents
 for i=1 to Docs.Count
 set Doc = Docs(i)
 docid = Doc.ID
 label = Doc.Label %>
<tr>
<td width=25 valign=bottom align=right>
<a HREF="javascript:CheckinDocument('<%= docid %>')"><img alt="Check In" src="images/sckin.gif" align=bottom border=0 width=20 height=20></a>
</td>

<td width=25 valign=bottom align=right>
<a HREF="javascript:CancelCheckoutDocument('<%= docid %>')"><img alt="Cancel Checkout" src="images/scanckout.gif" align=bottom border=0 width=20 height=20></a>
</td>

<td valign=bottom>
<a HREF="javascript:ShowDocument('<%=docid%>')">
<img alt="ShowDocument" src="<%= oDocUtil.IconFile(Doc) %>" align=bottom border=0 width=32 height=32></a>
<em><%= Server.HTMLEncode(label) %></em>
</td>

<% if LibraryObj.SystemType = Application("idmSysTypeDS") then %>
<td valign=bottom align=left><font size=2>
&nbsp;&nbsp;&nbsp;&nbsp;<%= Server.HTMLEncode(Doc.ID) %>&nbsp;&nbsp;&nbsp;&nbsp;</font></td>
<td valign=bottom align=left><font size=2>
&nbsp;&nbsp;&nbsp;&nbsp;<%= Server.HTMLEncode(Doc.ClassDescription.Name) %>&nbsp;&nbsp;&nbsp;&nbsp;</font></td>
<td valign=bottom align=left><font size=2>
&nbsp;&nbsp;&nbsp;&nbsp;<%= Server.HTMLEncode(Doc.Version.CheckoutDate) %>&nbsp;&nbsp;&nbsp;&nbsp;</font></td>
<td valign=bottom align=left><font size=2>
&nbsp;&nbsp;&nbsp;&nbsp;<%= Server.HTMLEncode(Doc.GetExtendedProperty("idmDocCurVerNum").FormatValue) %>&nbsp;&nbsp;&nbsp;&nbsp;</font></td>
<% end if %>
<td valign=bottom><a HREF="javascript:ShowProperty(1,'<%=docid%>')">
<img alt="'<%=Server.HTMLEncode(Doc.Label)%>' Properties" src="images/prop.gif" align=bottom border=0 width=16 height=21></a></td>
</tr>
<% next %>
</table>

</body>
</html>
